package com.hxy.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 */
@Component
public class Receiver {
    /**
     * 接收消息，然后处理消息
     */
    @RabbitListener(queues = {"${mq.queue.name}"})
    public void process(String msg) {
        //处理消息
        System.out.println("receiver:" + msg);
    }

}
